Tegra Stats Utility
L4T provides the Tegra Stats utility (tegrastats), which reports memory usage and processor usage for NVIDIA® Tegra® devices.
JetPack installer or the flashing script places the script in the home directory on the target at:
/home/ubuntu/tegrastats
On the host system, the script is delivered in the TAR file at:
Linux_for_Tegra/nv_tegra/nv_tools.tbz2
Reported Statistics
The following table shows the statistics the Tegra Stats utility reports.
Statistic | X | Y | Z |
RAM X/Y (lfb NxZ) Largest Free Block (lfb) is a statistic about the memory allocator, and refers to the largest contiguous block of physical memory that can currently be allocated. It is at most 4 MB, and can become smaller with memory fragmentation. Note: The word physical in the above; allocations made in virtual memory can be bigger. | Amount of RAM in use in MB | Total amount of RAM available for applications | Z is the size of the largest free block, N the number of free blocks of this size. |
CPU [X%,Y%, , ]@Z Note: T30 has up to four CPU cores in the G-Cluster and one CPU core in the LP-Cluster. | Load statistics for each of the CPU cores relative to the current running frequency Z, or 'off' in case a core is currently powered down. This is a rough approximation based on time spent in system idle process as reported by the Linux kernel in /proc/stat file. | Load statistics for each of the CPU cores relative to the current running frequency Z, or 'off' in case a core is currently powered down. This is a rough approximation based on time spent in system idle process as reported by the Linux kernel in /proc/stat file. | CPU frequency in MHz, which dynamically goes up or down depending on the CPU workload |
avp X%@Y AVP is the audio/video processor, which is not visible to the OS or applications. However, some forms of video decode/encode make heavy use of it. Note: From T210, the hardware AVP is replaced by ARM7 | Percent of the AVP or ARM7 that is being used (the AVP load) relative to the current running frequency | AVP or ARM7 frequency in MHz, which dynamically goes up or down depending on the AVP workload | N/A |
Deprecated beginning with R24.1. vde Y VDE is the video hardware engine. | N/A | VDE frequency in MHz | N/A |
edp limit X | Limit of the CPU maximum frequency | N/A | N/A |
emc X%@Y EMC is the external memory controller, through which all sysmem/carve-out/GART memory accesses go. | Percent of the EMC memory bandwidth that is being used, relative to the current running frequency | EMC frequency in MHz | N/A |
GR3D X%@Y GR3D is the GPU engine. | Percent of the GR3D that is being used, relative to the current running frequency | GR3D frequency in MHz | N/A |
MSENC Y MSENC is the video hardware encoding engine. Note: Supported beginning R24.2.1 | N/A | MSENC frequency in MHz | N/A |
NVDEC Y NVDEC is the video hardware decoding engine. Note: Supported beginning R24.2.1 | N/A | NVDEC frequency in MHz | N/A |
Example Output
The following example output is extracted from running a 1080p video playback use case. CPU frequency is running between 300 and 750 MHz and only one CPU is active.
Notes: | The examples provided are for previous Tegra devices. |
E/TegraStats( 7484): RAM 92/184MB (lfb 1x4MB) | DFS(%@MHz): cpu [52%,35%]@527 avp 18%@100 vde 0%@240 emc 17%@300
E/TegraStats( 7484): RAM 93/184MB (lfb 1x4MB) | DFS(%@MHz): cpu [51%,51%]@750 avp 8%@100 vde 0%@240 emc 17%@300
E/TegraStats( 7484): RAM 93/184MB (lfb 1x4MB) | DFS(%@MHz): cpu [58%,45%]@600 avp 8%@100 vde 0%@240 emc 16%@300
E/TegraStats( 7484): RAM 93/184MB (lfb 1x4MB) | DFS(%@MHz): cpu [48%,49%]@463 avp 8%@100 vde 0%@240 emc 17%@300
E/TegraStats( 7484): RAM 93/184MB (lfb 1x4MB) | DFS(%@MHz): cpu [60%,41%]@411 avp 8%@100 vde 0%@240 emc 17%@300
E/TegraStats( 7484): RAM 93/184MB (lfb 1x4MB) | DFS(%@MHz): cpu [60%,48%]@384 avp 9%@100 vde 0%@240 emc 18%@300
E/TegraStats( 7484): RAM 93/184MB (lfb 1x4MB) | DFS(%@MHz): cpu [60%,44%]@438 avp 10%@100 vde 0%@240 emc 48%@108
E/TegraStats( 7484): RAM 93/184MB (lfb 1x4MB) | DFS(%@MHz): cpu [44%,53%]@411 avp 8%@100 vde 0%@240 emc 16%@300
E/TegraStats( 7484): RAM 93/184MB (lfb 1x4MB) | DFS(%@MHz): cpu [57%,47%]@359 avp 8%@100 vde 0%@240 emc 17%@300
E/TegraStats( 7484): RAM 93/184MB (lfb 1x4MB) | DFS(%@MHz): cpu [55%,44%]@750 avp 8%@100 vde 0%@240 emc 17%@300
E/TegraStats(7484): RAM 98/184MB (lfb 1x1MB) | DFS(%@MHz): cpu [77%,68%]@300 avp 2%@100 vde 0%@240 emc 14%@300
E/TegraStats(7484): RAM 94/184MB (lfb 1x2MB) | DFS(%@MHz): cpu [35%,29%]@300 avp 2%@100 vde 0%@240 emc 14%@300
E/TegraStats(7484): RAM 95/184MB (lfb 1x2MB) | DFS(%@MHz): cpu [35%,29%]@300 avp 2%@100 vde 0%@240 emc 14%@300
…
Running Tegra Stats
When you run tegrastats on Linux devices, it prints statistics to stdout.
Example Log Print
E/TegraStats( 3627): RAM 250/490MB | DFS(%@MHz): cpu [61%,45%]@835 avp 17%@100 vde 34%@216 emc 25%@333
To run tegrastats
•On the target, execute the following commands:
sudo /home/Ubuntu/tegrastats <delay>
Where <delay> is the frequency of log prints, expressed in milliseconds (1000 means print every second).
To stop tegrastats
•On the target, execute the following commands:
sudo ps -a
sudo kill <pid>
Where <pid> is the process ID of tegrastats as reported by the ps command.
To max out the clock frequencies
•On the target, execute the following command:
sudo /home/ubuntu/tegrastats -max
which forces all runtime-modifiable clock frequencies to their maximum values. When run this way, tegrastats quits immediately after setting the clocks.
Note: | This option is provided only for testing purposes. |
To return clock frequencies back to default values
•On the target, execute the following command:
sudo /home/ubuntu/tegrastats -default
Re-Deploying Tegra Stats
The Tegra Stats Utility is preinstalled in the default root file system under /home/ubuntu. If you have modified the root file system configuration and removed tegrastats from the build, you can re-deploy it on the target at runtime.
To re-deploy tegrastats
•Execute the following commands from the debug host PC:
scp tegrastats ubuntu@<TARGET_DEVICE_IP>:/home/ubuntu/
Example
The following is an example of default tegrastats execution.
sudo ./tegrastats
[sudo] password for ubuntu:
RAM 277/3854MB (lfb 700x4MB) SWAP 0/0MB (cached 0MB) cpu [0%,0%,0%,0%]@1912 EMC 0%@1600 AVP 5%@115 VDE 0 GR3D 0%@76 EDP limit 1912
RAM 277/3854MB (lfb 700x4MB) SWAP 0/0MB (cached 0MB) cpu [1%,0%,0%,1%]@102 EMC 1%@408 AVP 33%@12 VDE 0 GR3D 0%@76 EDP limit 1912
EMC - external memory controller, bus%@MHz
AVP - audio/video processor, processor%@MHz
VDE - video decoder engine, %MHz
GR3D - GPU, processor%@MHz